Computer graphics systems commonly are used for displaying graphical representations of objects on a two-dimensional video display screen. Current computer graphics systems provide highly detailed representations and are used in a variety of applications.
In typical computer graphics systems, an object to be represented on the display screen is broken down into graphics primitives. Primitives are basic components of a graphics display and may include points, lines, vectors and polygons, such as triangles. Typically, a hardware/software scheme is implemented to render, or draw, the graphics primitives that represent a view of one or more objects being represented on the display screen.
The primitives of the three-dimensional object to be rendered commonly are defined by a host computer in terms of primitive data. For example, when the primitive is a triangle, the host computer may define the primitive in terms of the X,Y,Z coordinates of its vertices, as well as the R, G, B color values of each vertex. Rendering hardware interpolates the primitive data to compute the display screen pixels that represent each primitive, and the R, G, B values for each pixel.
Early graphics systems failed to display images in a sufficiently realistic manner to represent or model complex three-dimensional objects. The images displayed by such systems exhibited extremely smooth surfaces absent textures, bumps, scratches, shadows and other surface details present in the object being modeled.
As a result, methods were developed to display images with improved surface detail. Texture mapping is one such method that involves mapping a source image, referred to as a texture, onto a surface of a three-dimensional object, and thereafter mapping the textured three-dimensional object to the two-dimensional graphics display screen to display the resulting image. Texture mapped surface detail attributes commonly include color, specular reflection, vector perturbation, specularity, transparency, shadows, surface irregularities and grading.
Texture mapping involves applying one or more point elements (texels) of a texture to each point element (pixel) of the displayed portion of the object to which the texture is being mapped. Texture mapping hardware is conventionally provided with information indicating the manner in which the texels in a texture map correspond to the pixels on the display screen that represent the object. Each texel in a texture map is defined by S and T coordinates which identify its location in the two-dimensional texture map. For each pixel, the corresponding texel or texels that map to it are accessed from the texture map, and incorporated into the final R, G, B values generated for the pixel to represent the textured object on the display screen.
Blending is a technique that combines the R, G, B color values of a pixel (the "source" pixel) being processed with the R, G, B color values of a corresponding pixel (the "destination" pixel), previously computed and stored for example in a buffer (such as a frame buffer). The source pixel and the destination pixel have the same x, y screen coordinates. An alpha .alpha. value, associated with the source pixel, controls how much of the destination pixel color values should be combined with those of the source pixel.
Without blending, the color values of the source pixel overwrite the existing color values of the destination pixel, as though the source pixel is opaque. With blending, a user, for example, may control, to a limited degree of resolution, how much of the existing destination pixel color value should be combined with that of a source pixel. Thus, blending is used to create a translucent image, one that enables a portion of a previously stored color value "show through" a source color value. Color blending lies at the heart of techniques such as transparency, digital compositing, and painting.
One way to understand blending operations is to consider the R, G, B values of a source pixel as representing its color, and the alpha .alpha. value as representing its transparency (or opacity). Levels of transparency range from completely transparent to somewhat transparent (translucent) to opaque. In standard computer graphics systems that employ blending, alpha .alpha. is a digital word of a certain number of bits that has a value between 0 and 1. If .alpha.=0, then the pixel is transparent. If .alpha.=1, then the pixel is opaque. If .alpha. has some value between 0 and 1, then the pixel is translucent.
Blending can be understood with reference to the following analogous example. If one is viewing a destination object through colored glass, then the color seen is partly the color of the glass and partly the color of the object. The percentage of one color seen versus the other, varies depending on the transmission properties of the glass. If the glass transmits 80% of the light that strikes it, for example, then the glass has a transparency of 80% (an opacity of 20%), and the color seen is a combination of 20% glass color and 80% object color. Objects also can be viewed through multiple translucent (or transparent) surfaces such as multiple pieces of glass. Similarly, computer graphics blending operations can be performed with multiple source images. During blending, color values of source pixels are combined with color values of corresponding destination pixels (on a pixel-by-pixel basis) in a two-stage process. The color values typically are combined by blending hardware in computer graphics systems. The source R.sub.s and destination R.sub.d values are combined separately from the source G.sub.s and destination G.sub.d values which are combined separately from the source B.sub.s, and destination B.sub.d values. Each of the values is combined using digital arithmetic hardware according to standard blending equations that involve the color values and the source alpha .alpha. value. Such blending equations are standard in the industry and are listed in the OpenGL Programming Guide The Official Guide to Learning OpenGL, Release, by Neider, Davis and Woo (OpenGL Architecture Review Board), Addison-Wesley Publishing Company, Second Printing, August 1994, which reference herein is incorporated by reference in its entirety.
An example of a standard blending equation for back to front (in relation to a computer graphics view screen) blending is listed below. EQU R.sub.d (1-.alpha..sub.s)+R.sub.s .alpha..sub.s,
wherein R.sub.d =the destination R value, R.sub.s =the source R value, and .alpha..sub.s =the source .alpha. value. This equation typically is implemented by digital blending hardware separately for the R values, the G values and the B values (where G and B would be substituted separately for R in the above equation).
FIG. 1 is block diagram of a prior art blending system employed by a computer graphics system. As shown, the blending system includes a source 100 that provides the source pixel values R.sub.s, G.sub.s, .alpha..sub.s, as well as blending hardware 102, and a buffer 104 that stores destination pixel values R.sub.d, G.sub.d, B.sub.d. It should be appreciated that source 100 can be any component in a computer graphics system upstream of blending hardware 102 such as a texture mapping chip or the like. Similarly, buffer 104 can be any such storage device downstream of blending hardware 102 and upstream of a display screen, such as a frame buffer.
During operation, source pixel values R.sub.s, G.sub.s, B.sub.s, .alpha..sub.s, are provided by source 100 to blending hardware 102 along buses 106 and 108. Also, buffer 104 provides destination pixel color values R.sub.d, G.sub.d, B.sub.d along bus 110 to blending hardware 102. Blending hardware 102 then combines the source color values with the destination color values using the source alpha value .alpha..sub.s, to control the level of transparency. The resulting blended pixel color values are provided by blending hardware 102 along bus 112 to buffer 104 which stores the resulting color values as the new destination pixel color values.
As noted above, blending hardware 102 typically implements a standard blending equation to separately combine the R values R.sub.s and R.sub.d, the G values G.sub.s, and G.sub.d, and the B values B.sub.s, and B.sub.d, each having the same level of transparency controlled by the alpha source value .alpha..sub.s. Thus, each of the source color values R.sub.s, G.sub.s, and B.sub.s is separately provided from source 100 to blending hardware 102 along bus 108. Similarly, each of destination pixel color values R.sub.d, G.sub.d, B.sub.d is separately provided by bus 104 to blending hardware 102 along bus 110.
Typically, each of the color values .alpha., R, G, B is an f-bit word where f is an integer. f can be 8 for example. The hardware must be capable of transferring and manipulating f-bit digital words. In the example shown in FIG. 1, each of buses 106, 108, 110 and 112 is an f-bit bus. Additionally, the digital logic employed by the blending hardware is capable of manipulating f-bit digital words. It should be appreciated that as the number of bits f in each word increases, the complexity and cost of the blending hardware and associated buses also increases.
FIG. 2 is a partial block, partial schematic diagram of a particular embodiment of a prior art blending system, wherein like reference characters are used to denote like elements in the block diagram of FIG. 1. As shown, like FIG. 1, the system includes source 100, blending hardware 102, and buffer 104 which, in this example, is a frame buffer. Blending hardware 102 includes a digital subtractor 118, digital multipliers 114 and 126, and a digital adder 130. It is assumed in this particular example that each of the pixel color values .alpha., R, G, B is an 8-bit word. During operation, source alpha value a, is provided from source 100 along bus 106 to subtractor 118 and along bus 116 to multiplier 114. Simultaneously, source color value R.sub.s, is provided from source 100 along bus 108 to multiplier 114. It should be understood that each source color value R.sub.s, G.sub.s, and B.sub.s is provided separately from source 100 and each destination pixel color value R.sub.d, G.sub.d, B.sub.d is provided separately frame buffer 104. The example will be described only with respect to the R color values R.sub.s and R.sub.d.
An 8-bit digital word representing 1 is provided along bus 120 to subtractor 118. Subtractor 118 provides the 8-bit difference 1-.alpha..sub.s along 8-bit bus 122 to multiplier 126. Multiplier 114 provides the 8-bit product R.sub.s .alpha..sub.s along bus 124 adder 130.
Simultaneously, frame buffer 104 provides destination pixel color value R.sub.d along bus 110 to multiplier 126. Multiplier 126, in turn, provides product R.sub.d (1-.alpha..sub.s) along 8-bit bus 128 to adder 130. Adder 130 provides the 8-bit sum R.sub.d (1-.alpha..sub.s)+R.sub.s .alpha..sub.s along bus 112 to frame buffer 104. The sum equation represents the new blended destination pixel color value R.sub.d which overwrites previous destination pixel color value R.sub.d.
The process described above is conducted simultaneously for color values G and B (wherein G and B would be substituted for R) by similar hardware (not shown) such that new destination pixel values R.sub.d, G.sub.d, B.sub.d overwrite the previous destination pixel color values in frame buffer 104. This process can be repeated multiple times for multiple different source pixel color values when multiple images are to be blended.
Not shown in FIG. 2 are correction blocks that are located between subtractor 118 and multiplier 126 within bus 122, and between adder 130 and frame buffer 104 within bus 112. As will be understood by those skilled in the art, the correction blocks (not shown) provide correction factors to the digital words to correct for inaccuracies or errors caused by the digital arithmetic operations.
The resolution (the number of bits) in each of the digital words is limited by the hardware employed by the blending system. The resolution of alpha .alpha., controls the number of available transparency levels. Thus, the hardware is the limiting factor in the available levels of transparency.
When alpha is an 8-bit word, there are 256 available levels of transparency. This is a fairly limited number of levels of transparency for most graphics applications. If many images are to be blended together, requiring many iterations by the blending hardware with multiple different source pixels (one for each image to be blended), then the level of transparency of the resulting blended image will begin to approach opaqueness due to the blending scheme.
It is desirable in computer graphics systems that provide blending, to provide as many transparency levels as possible, which gives the user more flexibility in blending images, particularly where multiple images are to be blended. One possible solution is to increase the resolution of alpha .alpha. by increasing the bit-handling capacity of the blending hardware. For example, increasing alpha .alpha. from an 8-bit word to a 16-bit word improves the resolution tremendously but requires the employment of more complex, expensive and probably physically larger digital hardware.
It accordingly is an aim of the present invention to provide a computer graphics system having blending capabilities with increased transparency levels without significantly increasing hardware cost and complexity.